#include <bits/stdc++.h>

using namespace std;
using ll = long long;

int main() {
    ios::sync_with_stdio(false);
    cin.tie(nullptr);
    int n;
    cin >> n;
    vector<ll> a(n + 1, 0);
    vector<ll> s(n + 1, 0);
    for (int i = 1; i <= n; ++i) {
        cin >> a[i];
        s[i] = s[i - 1] + a[i];
    }
    ll max_val = 0;
    for (int i = 1; i <= n; ++i) {
        int prev = max(0, i - 10);
        ll current = s[i] - s[prev];
        max_val = max(max_val, current);
    }
    cout << max_val << endl;
    return 0;
}